package com.dyp.websocket.resource;

import com.dyp.websocket.endpoint.IMServer;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
@RequestMapping(value = "/im")
public class IMServerResource {
    @PostMapping("/push/{toUserId}")
    public String pushToUser(@RequestBody String message, @PathVariable("toUserId") String toUserId) throws IOException {
        IMServer.backendSendInfoToUser(message,toUserId);
        return "send success";
    }
}
